﻿using System.Windows.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Keyboard = Microsoft.Xna.Framework.Input.Keyboard;

namespace Silverlight3dApp.Learning.Lesson03
{
    public class CollisionGame : Game
    {
        private SpriteManager _spriteManager;

        public CollisionGame()
        {
            Content.RootDirectory = "Content";
        }

        protected override void Initialize()
        {
            _spriteManager = new SpriteManager(this);
            Components.Add(_spriteManager);
            base.Initialize();
        }

        protected override void LoadContent()
        {
            new SpriteBatch(GraphicsDevice);
            base.LoadContent();
        }

        protected override void Update(GameTime gameTime)
        {
            var keyState = Keyboard.GetState();
            if (keyState.IsKeyDown(Key.Escape))
            {
                Exit();
            }

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Colors.CornflowerBlue);
            base.Draw(gameTime);
        }
    }
}